package ucas.pin.web.repositories;

import ucas.pin.web.domain.Disease;
import ucas.pin.web.domain.MedMaterial;

import java.util.Collection;

import org.springframework.data.neo4j.annotation.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;

/**
 * @author pdtyreus
 * @author Mark Angrish
 */
@Repository
public interface DiseaseRepository extends PagingAndSortingRepository<Disease, Long> {
	@Query("MATCH (p:Prescription)-[r_t:Treat]->(d:Disease) where d.name = {0} return p,r_t,d")
	Collection<Disease> getGraphByName(String name);
	
	@Query("MATCH (d:Disease) where d.name = {0} return d")
	Collection<Disease> getEntityByName(String name);
	
	@Query("MATCH (d:Disease) where d.name =~ {0} return d")
	Collection<Disease> findDiseaseByNameLike(String name);
}
